package leetcode.剑指offer.后40;

import org.junit.Test;

/**
 * @author :songyaozhang
 * @date :Created 2021/8/2 9:58
 * @description :
 */
public class 剑指_64_求1到n的和{
    @Test
    public void test() {
        Solution solution = new Solution();
        System.out.println(solution.sumNums(100));
    }

    class Solution {
        public int sumNums(int n) {
            return (1 + n) * n / 2;
        }
    }
}
